package route

import (
	"camera_app/api/controller"
	"camera_app/entity"
	"camera_app/middleware"
	service "camera_app/repository"

	"github.com/gin-gonic/gin"
	"gorm.io/gorm"
)

func NewUserRoute(db *gorm.DB, group *gin.RouterGroup) {
	ur := &service.UserRepository{
		User: &entity.User{},
		DB:   db,
	}
	uc := controller.NewUserController(ur)
	group.GET("/user/getUser", middleware.HasAuth, uc.GetUserHandler)
	group.POST("/user/login", uc.LoginHandler)
}
